|
1
|
|
|
/** |
|
2
|
|
|
* @fileoverview Externs for ieee754-buffer 0.0.1 |
|
3
|
|
|
* @see https://github.com/rochars/ieee754-buffer |
|
4
|
|
|
* @externs |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Pack a IEEE 754 floating point number. |
|
9
|
|
|
* Derived from typedarray.js by Linden Research, MIT License. |
|
10
|
|
|
* @see https://bitbucket.org/lindenlab/llsd/raw/7d2646cd3f9b4c806e73aebc4b32bd81e4047fdc/js/typedarray.js |
|
11
|
|
|
* @param {!Uint8Array|!Array<number>} buffer The buffer. |
|
12
|
|
|
* @param {number} index The index to write on the buffer. |
|
13
|
|
|
* @param {number} num The number. |
|
14
|
|
|
* @param {number} ebits The number of bits of the exponent. |
|
15
|
|
|
* @param {number} fbits The number of bits of the fraction. |
|
16
|
|
|
* @return {number} The next index to write on the buffer. |
|
17
|
|
|
*/ |
|
18
|
|
|
function pack(buffer, index, num, ebits, fbits) {} |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Unpack a IEEE 754 floating point number. |
|
22
|
|
|
* Derived from IEEE754 by DeNA Co., Ltd., MIT License. |
|
23
|
|
|
* Adapted to handle NaN. Should port the solution to the original repo. |
|
24
|
|
|
* @see https://github.com/kazuho/ieee754.js/blob/master/ieee754.js |
|
25
|
|
|
* @param {!Uint8Array|!Array<number>} buffer The buffer. |
|
26
|
|
|
* @param {number} index The index to read from the buffer. |
|
27
|
|
|
* @param {number} ebits The number of bits of the exponent. |
|
28
|
|
|
* @param {number} fbits The number of bits of the fraction. |
|
29
|
|
|
* @return {number} The floating point number. |
|
30
|
|
|
*/ |
|
31
|
|
|
function unpack(buffer, index, ebits, fbits) {} |
|
32
|
|
|
|